package apartmentRentGWT.client;

import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * User: LeOn
 * Date: 10/14/12
 * Time: 3:22 PM
 */
public class Choice {
    private String name;
    private String firstPlayerChoice;
    private String secondPlayerChoice;

    public Choice() {
    }

    public Choice(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getFirstPlayerChoice() {
        return firstPlayerChoice;
    }

    public void setFirstPlayerChoice(String firstPlayerChoice) {
        this.firstPlayerChoice = firstPlayerChoice;
    }

    public String getSecondPlayerChoice() {
        return secondPlayerChoice;
    }

    public void setSecondPlayerChoice(String secondPlayerChoice) {
        this.secondPlayerChoice = secondPlayerChoice;
    }


    public static void getMutualChoice(Choice c){
        Random generator = new Random();
        int rnd = generator.nextInt(3)+1;
        switch (rnd){
            case 1:
                c.setFirstPlayerChoice("No");
                c.setSecondPlayerChoice("No");
                break;
            case 2:
                c.setFirstPlayerChoice("No");
                c.setSecondPlayerChoice("Yes");
                break;
            case 3:
                c.setFirstPlayerChoice("Yes");
                c.setSecondPlayerChoice("No");
                break;
        }
    }
}
